home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / xdme_1.84_src.lha / XDME / include / gen_spc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-21  |  30.7 KB  |  1,155 lines

  1. static const char *spc_names[] = {
  2.                 "activetofront",
  3.                 "appicon",
  4.                 "appiconclickaction",
  5.                 "appicondropaction",
  6.                 "appiconname",
  7.                 "appicontitle",
  8.                 "ascii",
  9.                 "autoindent",
  10.                 "autosplit",
  11.                 "autounblock",
  12.                 "bbpen",
  13.                 "bgpen",
  14.                 "block",
  15.                 "cmdshell",
  16.                 "cmdshellname",
  17.                 "cmdshellprompt",
  18.                 "colno",
  19.                 "comlinemode",
  20.                 "currentdir",
  21.                 "currentline",
  22.                 "currentword",
  23.                 "debug",
  24.                 "dobackup",
  25.                 "ed",
  26.                 "errorsoncmdshell",
  27.                 "fgpen",
  28.                 "filename",
  29.                 "findstr",
  30.                 "firstnb",
  31.                 "fname",
  32.                 "followcursor",
  33.                 "globalsearch",
  34.                 "gtbformat",
  35.                 "hgpen",
  36.                 "icon",
  37.                 "iconactive",
  38.                 "iconmode",
  39.                 "icontitle",
  40.                 "ignorecase",
  41.                 "infixmode",
  42.                 "insertmode",
  43.                 "itemcheck",
  44.                 "keytable",
  45.                 "lineno",
  46.                 "margin",
  47.                 "menufontname",
  48.                 "menufontsize",
  49.                 "menustrip",
  50.                 "modified",
  51.                 "nicepaging",
  52.                 "norequest",
  53.                 "numlines",
  54.                 "parcol",
  55.                 "pens",
  56.                 "pos",
  57.                 "prevnbline",
  58.                 "recentword",
  59.                 "repstr",
  60.                 "reqpattern",
  61.                 "reqresult",
  62.                 "restofline",
  63.                 "rexxport",
  64.                 "rxresult",
  65.                 "saveicons",
  66.                 "savetabs",
  67.                 "scanf",
  68.                 "shortlines",
  69.                 "showtitle",
  70.                 "simpletabs",
  71.                 "sourcebreaks",
  72.                 "tabstop",
  73.                 "tbpen",
  74.                 "tfpen",
  75.                 "title",
  76.                 "txtfontname",
  77.                 "txtfontsize",
  78.                 "version",
  79.                 "viewmode",
  80.                 "warningsoncmdshell",
  81.                 "window",
  82.                 "windowcycling",
  83.                 "windowtitles",
  84.                 "wordwrap",
  85. #define      _I_activetofront_  0
  86. #define      _I_appicon_  1
  87. #define      _I_appiconclickaction_  2
  88. #define      _I_appicondropaction_  3
  89. #define      _I_appiconname_  4
  90. #define      _I_appicontitle_  5
  91. #define      _I_ascii_  6
  92. #define      _I_autoindent_  7
  93. #define      _I_autosplit_  8
  94. #define      _I_autounblock_  9
  95. #define      _I_bbpen_  10
  96. #define      _I_bgpen_  11
  97. #define      _I_block_  12
  98. #define      _I_cmdshell_  13
  99. #define      _I_cmdshellname_  14
  100. #define      _I_cmdshellprompt_  15
  101. #define      _I_colno_  16
  102. #define      _I_comlinemode_  17
  103. #define      _I_currentdir_  18
  104. #define      _I_currentline_  19
  105. #define      _I_currentword_  20
  106. #define      _I_debug_  21
  107. #define      _I_dobackup_  22
  108. #define      _I_ed_  23
  109. #define      _I_errorsoncmdshell_  24
  110. #define      _I_fgpen_  25
  111. #define      _I_filename_  26
  112. #define      _I_findstr_  27
  113. #define      _I_firstnb_  28
  114. #define      _I_fname_  29
  115. #define      _I_followcursor_  30
  116. #define      _I_globalsearch_  31
  117. #define      _I_gtbformat_  32
  118. #define      _I_hgpen_  33
  119. #define      _I_icon_  34
  120. #define      _I_iconactive_  35
  121. #define      _I_iconmode_  36
  122. #define      _I_icontitle_  37
  123. #define      _I_ignorecase_  38
  124. #define      _I_infixmode_  39
  125. #define      _I_insertmode_  40
  126. #define      _I_itemcheck_  41
  127. #define      _I_keytable_  42
  128. #define      _I_lineno_  43
  129. #define      _I_margin_  44
  130. #define      _I_menufontname_  45
  131. #define      _I_menufontsize_  46
  132. #define      _I_menustrip_  47
  133. #define      _I_modified_  48
  134. #define      _I_nicepaging_  49
  135. #define      _I_norequest_  50
  136. #define      _I_numlines_  51
  137. #define      _I_parcol_  52
  138. #define      _I_pens_  53
  139. #define      _I_pos_  54
  140. #define      _I_prevnbline_  55
  141. #define      _I_recentword_  56
  142. #define      _I_repstr_  57
  143. #define      _I_reqpattern_  58
  144. #define      _I_reqresult_  59
  145. #define      _I_restofline_  60
  146. #define      _I_rexxport_  61
  147. #define      _I_rxresult_  62
  148. #define      _I_saveicons_  63
  149. #define      _I_savetabs_  64
  150. #define      _I_scanf_  65
  151. #define      _I_shortlines_  66
  152. #define      _I_showtitle_  67
  153. #define      _I_simpletabs_  68
  154. #define      _I_sourcebreaks_  69
  155. #define      _I_tabstop_  70
  156. #define      _I_tbpen_  71
  157. #define      _I_tfpen_  72
  158. #define      _I_title_  73
  159. #define      _I_txtfontname_  74
  160. #define      _I_txtfontsize_  75
  161. #define      _I_version_  76
  162. #define      _I_viewmode_  77
  163. #define      _I_warningsoncmdshell_  78
  164. #define      _I_window_  79
  165. #define      _I_windowcycling_  80
  166. #define      _I_windowtitles_  81
  167. #define      _I_wordwrap_  82
  168. };
  169.  
  170. #define spc_num_vars (sizeof(spc_names)/sizeof(spc_names[0]))
  171.  
  172. static char *spc_get(long lock) {
  173.     long array[6];
  174.     char *value   = NULL;
  175.     char *av0_bak = av[0];
  176.     char *av1_bak = av[1];
  177.     char *av2_bak = av[2];
  178.     switch (lock) {
  179.      case _I_activetofront_:
  180.      value = GETF_ACTIVATETOFRONT (Ep)? "1": "0"; 
  181.     ;;break;
  182.      case _I_appicon_:
  183.      value = GETF_APIC_ACTIVE (Ep)? "1": "0"; 
  184.     ;;break;
  185.      case _I_appiconclickaction_:
  186.      value = APIC_ActionDblClick; 
  187.     ;;break;
  188.      case _I_appicondropaction_:
  189.      value = APIC_ActionDrop; 
  190.     ;;break;
  191.      case _I_appiconname_:
  192.      value = APIC_IconFile; 
  193.     ;;break;
  194.      case _I_appicontitle_:
  195.      value = APIC_IconTitle; 
  196.     ;;break;
  197.      case _I_ascii_:
  198.      value = ltostr((long)Current[Ep->column]); 
  199.     ;;break;
  200.      case _I_autoindent_:
  201.      value = GETF_AUTOINDENT (Ep)? "1": "0"; 
  202.     ;;break;
  203.      case _I_autosplit_:
  204.      value = GETF_AUTOSPLIT (Ep)? "1": "0"; 
  205.     ;;break;
  206.      case _I_autounblock_:
  207.      value = GETF_AUTOUNBLOCK (Ep)? "1": "0"; 
  208.     ;;break;
  209.      case _I_bbpen_:
  210.      value = ltostr((long)BLOCK_BPEN(Ep)); 
  211.     ;;break;
  212.      case _I_bgpen_:
  213.      value = ltostr((long)TEXT_BPEN(Ep)); 
  214.     ;;break;
  215.      case _I_block_:
  216.     {
  217.         Block block;
  218.         get_block(&block);
  219.         if (VSTK_Internal)
  220.         sprintf (tmp_buffer, "%08lx %lx %08lx %08lx %08lx %08lx",
  221.                     (long)block.ep,
  222.                     (long)block.type,
  223.                     (long)block.start_line,
  224.                     (long)block.start_column,
  225.                     (long)block.end_line,
  226.                     (long)block.end_column);
  227.         else
  228.         sprintf (tmp_buffer, "%s %ld %ld %ld %ld %ld",
  229.                     (long)((struct Node *)block.ep)->ln_Name,
  230.                     (long)block.type,
  231.                     (long)block.start_line,
  232.                     (long)block.start_column,
  233.                     (long)block.end_line,
  234.                     (long)block.end_column);
  235.         value = tmp_buffer;
  236.     }
  237.     ;;break;
  238.      case _I_cmdshell_:
  239.      value = GETF_CMDSH_ACTIVE (Ep)? "1": "0"; 
  240.     ;;break;
  241.      case _I_cmdshellname_:
  242.      value = CMDSH_FileName; 
  243.     ;;break;
  244.      case _I_cmdshellprompt_:
  245.      value = CMDSH_Prompt; 
  246.     ;;break;
  247.      case _I_colno_:
  248.      value = ltostr((long)Ep->column + 1); 
  249.     ;;break;
  250.      case _I_comlinemode_:
  251.      value = GETF_COMLINEMODE (Ep)? "1": "0"; 
  252.     ;;break;
  253.      case _I_currentdir_:
  254.      if (NameFromLock(Ep->dirlock, tmp_buffer, sizeof(tmp_buffer)))
  255.         value = tmp_buffer;
  256.     
  257.     ;;break;
  258.      case _I_currentline_:
  259.     value = Current
  260.     ;;break;
  261.      case _I_currentword_:
  262.     value = current_word()
  263.     ;;break;
  264.      case _I_debug_:
  265.      value = GETF_DEBUG (Ep)? "1": "0"; 
  266.     ;;break;
  267.      case _I_dobackup_:
  268.      value = GETF_DOBACK (Ep)? "1": "0"; 
  269.     ;;break;
  270.      case _I_ed_:
  271.     
  272.         if (VSTK_Internal)
  273.         sprintf (value = tmp_buffer, "%08lx", Ep);
  274.         else
  275.         value =  ((struct Node *)Ep)->ln_Name;
  276.     
  277.     ;;break;
  278.      case _I_errorsoncmdshell_:
  279.      value = CMDSH_ErrorsOut? "1": "0"; 
  280.     ;;break;
  281.      case _I_fgpen_:
  282.      value = ltostr((long)TEXT_FPEN(Ep)); 
  283.     ;;break;
  284.      case _I_filename_:
  285.      if (getpathto(Ep->dirlock, Ep->name, tmp_buffer))
  286.         value = tmp_buffer;
  287.     
  288.     ;;break;
  289.      case _I_findstr_:
  290.      value = Fstr; 
  291.     ;;break;
  292.      case _I_firstnb_:
  293.     value = ltostr(firstns (Current) + 1);
  294.     ;;break;
  295.      case _I_fname_:
  296.      value = Ep->name; 
  297.     ;;break;
  298.      case _I_followcursor_:
  299.      value = GETF_FOLLOWCURSOR (Ep)? "1": "0"; 
  300.     ;;break;
  301.      case _I_globalsearch_:
  302.      value = GETF_GLOBALSEARCH (Ep)? "1": "0"; 
  303.     ;;break;
  304.      case _I_gtbformat_:
  305.      value = GTB_Format; 
  306.     ;;break;
  307.      case _I_hgpen_:
  308.      value = ltostr((long)BLOCK_FPEN(Ep)); 
  309.     ;;break;
  310.      case _I_icon_:
  311.     
  312.         if (GETF_ICONMODE(Ep)) {
  313.         array[0] = Ep->config.iwinx;
  314.         array[1] = Ep->config.iwiny;
  315.         } else {
  316.         array[0] = Ep->win->LeftEdge;
  317.         array[1] = Ep->win->TopEdge;
  318.         } /* if */
  319.         sprintf (tmp_buffer, "%ld %ld", array[0], array[1]);
  320.         value = tmp_buffer;
  321.     
  322.     ;;break;
  323.      case _I_iconactive_:
  324.      value = GETF_ICONACTIVE (Ep)? "1": "0"; 
  325.     ;;break;
  326.      case _I_iconmode_:
  327.      value = GETF_ICONMODE (Ep)? "1": "0"; 
  328.     ;;break;
  329.      case _I_icontitle_:
  330.      value = icontitle_pattern; 
  331.     ;;break;
  332.      case _I_ignorecase_:
  333.      value = GETF_IGNORECASE (Ep)? "1": "0"; 
  334.     ;;break;
  335.      case _I_infixmode_:
  336.      value = MathInfix? "1": "0"; 
  337.     ;;break;
  338.      case _I_insertmode_:
  339.      value = GETF_INSERTMODE (Ep)? "1": "0"; 
  340.     ;;break;
  341.      case _I_itemcheck_:
  342.      if (active_menu)
  343.         value = (((struct MenuItem *)active_menu)->Flags & CHECKED) ? "1": "0";
  344.     
  345.     ;;break;
  346.      case _I_keytable_:
  347.     
  348.         if ((value = (void*)currenthash()))
  349.         value = ((struct Node *)value)->ln_Name;
  350.     
  351.     ;;break;
  352.      case _I_lineno_:
  353.      value = ltostr((long)Ep->line + 1); 
  354.     ;;break;
  355.      case _I_margin_:
  356.      value = ltostr((long)Ep->config.margin); 
  357.     ;;break;
  358.      case _I_menufontname_:
  359.      value = menufont_ta.ta_Name; 
  360.     ;;break;
  361.      case _I_menufontsize_:
  362.      value = ltostr((long)menufont_ta.ta_YSize); 
  363.     ;;break;
  364.      case _I_menustrip_:
  365.     
  366.         if ((value = (void *)currentmenu()))
  367.         value = ((struct Node *)value)->ln_Name;
  368.     
  369.     ;;break;
  370.      case _I_modified_:
  371.      value = GETF_MODIFIED (Ep)? "1": "0"; 
  372.     ;;break;
  373.      case _I_nicepaging_:
  374.      value = GETF_NICEPAGING (Ep)? "1": "0"; 
  375.     ;;break;
  376.      case _I_norequest_:
  377.      value = GETF_NOREQUEST (Ep)? "1": "0"; 
  378.     ;;break;
  379.      case _I_numlines_:
  380.      value = ltostr((long)Ep->lines); 
  381.     ;;break;
  382.      case _I_parcol_:
  383.      value = ltostr((long)Ep->config.wwcol); 
  384.     ;;break;
  385.      case _I_pens_:
  386.     
  387.         array[0] =    TEXT_FPEN(Ep);
  388.         array[1] =    TEXT_BPEN(Ep);
  389.         array[2] = BLOCK_FPEN(Ep);
  390.         array[3] = BLOCK_BPEN(Ep);
  391.         array[4] = TITLE_FPEN(Ep);
  392.         array[5] = TITLE_BPEN(Ep);
  393.  
  394.         sprintf (tmp_buffer, "%ld %ld %ld %ld %ld %ld", array[0], array[1], array[2], array[3], array[4], array[5]);
  395.         value = tmp_buffer;
  396.     
  397.     ;;break;
  398.      case _I_pos_:
  399.     
  400.         if (VSTK_Internal)
  401.         sprintf (tmp_buffer, "%08lx %08lx %08lx", (long)Ep, (long)Ep->line, (long)Ep->column);
  402.         else
  403.         sprintf (tmp_buffer, "%s %ld %ld", ((struct Node *)Ep)->ln_Name, (long)Ep->line, (long)Ep->column);
  404.         value = tmp_buffer;
  405.     
  406.     ;;break;
  407.      case _I_prevnbline_:
  408.     {
  409.         int i = Ep->line;
  410.         while ((--i >= 0) && !GETTEXT(Ep,i)[0]);
  411.         value = (i >= 0)? GETTEXT(Ep,i): "";
  412.     }
  413.     ;;break;
  414.      case _I_recentword_:
  415.     value = recent_word()
  416.     ;;break;
  417.      case _I_repstr_:
  418.      value = Rstr; 
  419.     ;;break;
  420.      case _I_reqpattern_:
  421.      value = pattern; 
  422.     ;;break;
  423.      case _I_reqresult_:
  424.      value = ReqString; 
  425.     ;;break;
  426.      case _I_restofline_:
  427.     value = Current + Ep->column
  428.     ;;break;
  429.      case _I_rexxport_:
  430.      value = RexxPortName; 
  431.     ;;break;
  432.      case _I_rxresult_:
  433.      value = get_rexx_result(); 
  434.     ;;break;
  435.      case _I_saveicons_:
  436.      value = GETF_SAVEICONS (Ep)? "1": "0"; 
  437.     ;;break;
  438.      case _I_savetabs_:
  439.      value = GETF_SAVETABS (Ep)? "1": "0"; 
  440.     ;;break;
  441.      case _I_scanf_:
  442.      value = String; 
  443.     ;;break;
  444.      case _I_shortlines_:
  445.      value = GETF_SLINE (Ep)? "1": "0"; 
  446.     ;;break;
  447.      case _I_showtitle_:
  448.      value = GETF_SHOWTITLE (Ep)? "1": "0"; 
  449.     ;;break;
  450.      case _I_simpletabs_:
  451.      value = GETF_SIMPLETABS (Ep)? "1": "0"; 
  452.     ;;break;
  453.      case _I_sourcebreaks_:
  454.      value = GETF_SOURCEBREAKS (Ep)? "1": "0"; 
  455.     ;;break;
  456.      case _I_tabstop_:
  457.      value = ltostr((long)Ep->config.tabstop); 
  458.     ;;break;
  459.      case _I_tbpen_:
  460.      value = ltostr((long)TITLE_BPEN(Ep)); 
  461.     ;;break;
  462.      case _I_tfpen_:
  463.      value = ltostr((long)TITLE_FPEN(Ep)); 
  464.     ;;break;
  465.      case _I_title_:
  466.      value = title_pattern; 
  467.     ;;break;
  468.      case _I_txtfontname_:
  469.      value = (Ep->font? Ep->font->tf_Message.mn_Node.ln_Name: "*Defaultfont*"); 
  470.     ;;break;
  471.      case _I_txtfontsize_:
  472.      value = ltostr((long)(Ep->font? Ep->font->tf_YSize: (Ysize - LineDistance))); 
  473.     ;;break;
  474.      case _I_version_:
  475.      value = version; 
  476.     ;;break;
  477.      case _I_viewmode_:
  478.      value = GETF_VIEWMODE (Ep)? "1": "0"; 
  479.     ;;break;
  480.      case _I_warningsoncmdshell_:
  481.      value = CMDSH_WarningsOut? "1": "0"; 
  482.     ;;break;
  483.      case _I_window_:
  484.     
  485.         if (!GETF_ICONMODE(Ep)) {
  486.         array[0] = Ep->config.winx;
  487.         array[1] = Ep->config.winy;
  488.         array[2] = Ep->config.winwidth;
  489.         array[3] = Ep->config.winheight;
  490.         } else {
  491.         array[0] = Ep->win->LeftEdge;
  492.         array[1] = Ep->win->TopEdge;
  493.         array[2] = Ep->win->Width;
  494.         array[3] = Ep->win->Height;
  495.         } /* if */
  496.  
  497.         sprintf (tmp_buffer, "%d %d %d %d", array[0], array[1], array[2], array[3]);
  498.         value = tmp_buffer;
  499.     
  500.     ;;break;
  501.      case _I_windowcycling_:
  502.      value = GETF_WINDOWCYCLING (Ep)? "1": "0"; 
  503.     ;;break;
  504.      case _I_windowtitles_:
  505.      value = GETF_WINDOWTITLES (Ep)? "1": "0"; 
  506.     ;;break;
  507.      case _I_wordwrap_:
  508.      value = GETF_WORDWRAP (Ep)? "1": "0"; 
  509.     ;;break;
  510.     default:
  511.     return NULL;
  512.     }
  513.     return value;
  514. } /* spc_get */
  515.  
  516. static int spc_set(long lock, char *value) {
  517.     long array[6];
  518.     char *av0_bak = av[0];
  519.     char *av1_bak = av[1];
  520.     char *av2_bak = av[2];
  521.     switch (lock) {
  522.     case _I_activetofront_:
  523.      SETF_ACTIVATETOFRONT (Ep, test_arg (value, GETF_ACTIVATETOFRONT (Ep))); 
  524.     ;;break;
  525.     case _I_appicon_:
  526.     
  527.         array[0] = test_arg(value, GETF_APIC_ACTIVE (Ep));
  528.         if (array[0] != GETF_APIC_ACTIVE (Ep))
  529.             if (array[0]) do_apicshow();
  530.             else      do_apichide(); 
  531.     ;;break;
  532.     case _I_appiconclickaction_:
  533.      APIC_ActionDblClick = strrep (APIC_ActionDblClick, value); 
  534.     ;;break;
  535.     case _I_appicondropaction_:
  536.      APIC_ActionDrop = strrep (APIC_ActionDrop, value); 
  537.     ;;break;
  538.     case _I_appiconname_:
  539.      APIC_IconFile = strrep (APIC_IconFile, value); 
  540.     ;;break;
  541.     case _I_appicontitle_:
  542.      APIC_IconTitle = strrep (APIC_IconTitle, value); 
  543.     ;;break;
  544.     case _I_autoindent_:
  545.      SETF_AUTOINDENT (Ep, test_arg (value, GETF_AUTOINDENT (Ep))); 
  546.     ;;break;
  547.     case _I_autosplit_:
  548.      SETF_AUTOSPLIT (Ep, test_arg (value, GETF_AUTOSPLIT (Ep))); 
  549.     ;;break;
  550.     case _I_autounblock_:
  551.      SETF_AUTOUNBLOCK (Ep, test_arg (value, GETF_AUTOUNBLOCK (Ep))); 
  552.     ;;break;
  553.     case _I_bbpen_:
  554.      BLOCK_BPEN(Ep) = atol(value); 
  555.     ;;break;
  556.     case _I_bgpen_:
  557.      TEXT_BPEN(Ep) = atol(value); 
  558.     ;;break;
  559.     case _I_block_:
  560.     {
  561.         Block block;
  562.         
  563.  
  564.         if (VSTK_Internal)
  565.         sscanf (value, "%08lx %lx %08lx %08lx %08lx %08lx", &array[0], &array[1], &array[2], &array[3], &array[4], &array[5]);
  566.         else {
  567.         sscanf (value, "%s %ld %ld %ld %ld %ld", tmp_buffer, &array[1], &array[2], &array[3], &array[4], &array[5]);
  568.         array[0] = (long)finded (tmp_buffer, 0);
  569.         } /* if */
  570.  
  571.         block.ep           = (void *)array[0];
  572.         block.type           = array[1];
  573.         block.start_line   = array[2];
  574.         block.start_column = array[3];
  575.         block.end_line     = array[4];
  576.         block.end_column   = array[5];
  577.  
  578.     /* /* **** MISSING SAFETY CHECK!!!! **** */
  579.  
  580.         
  581.         set_block (&block);
  582.  
  583.         if (!GETF_ICONMODE(ActualBlock.ep))
  584.         
  585.         
  586.         
  587.         
  588.         displayblock(1);
  589.     
  590.     
  591.     
  592.     
  593.     }
  594.     ;;break;
  595.     case _I_cmdshell_:
  596.     
  597.         array[0] = test_arg(value, GETF_CMDSH_ACTIVE (Ep));
  598.         if (array[0] != GETF_CMDSH_ACTIVE (Ep))
  599.             if (array[0]) do_opencmdshell();
  600.             else      do_closecmdshell(); 
  601.     ;;break;
  602.     case _I_cmdshellname_:
  603.      CMDSH_FileName = strrep (CMDSH_FileName, value); 
  604.     ;;break;
  605.     case _I_cmdshellprompt_:
  606.      CMDSH_Prompt = strrep (CMDSH_Prompt, value); 
  607.     ;;break;
  608.     case _I_currentdir_:
  609.     
  610.         av[1] = value;
  611.         do_cd();
  612.         av[1] = av1_bak;
  613.     
  614.     ;;break;
  615.     case _I_debug_:
  616.      SETF_DEBUG (Ep, test_arg (value, GETF_DEBUG (Ep))); 
  617.     ;;break;
  618.     case _I_dobackup_:
  619.      SETF_DOBACK (Ep, test_arg (value, GETF_DOBACK (Ep))); 
  620.     ;;break;
  621.     case _I_ed_:
  622.     
  623.         if (VSTK_Internal)
  624.         sscanf (value, "%08lx", &array[0]);
  625.         else {
  626.         array[0] = (long)finded (value, 0);
  627.         } /* if */
  628.  
  629.     /* /* **** MISSING SAFETY CHECK!!!! **** */
  630.  
  631.         
  632.         switch_ed ((void *)array[0]);
  633.         
  634.  
  635.         ActivateWindow (Ep->win);                              
  636.         if (GETF_ACTIVATETOFRONT(Ep))
  637.         WindowToFront(Ep->win);
  638.         
  639.         
  640.     
  641.     
  642.     
  643.     
  644.     
  645.     ;;break;
  646.     case _I_errorsoncmdshell_:
  647.      CMDSH_ErrorsOut = test_arg (value, CMDSH_ErrorsOut); 
  648.     ;;break;
  649.     case _I_fgpen_:
  650.      TEXT_FPEN(Ep) = atol(value); 
  651.     ;;break;
  652.     case _I_filename_:
  653.     
  654.         av[1] = value;
  655.         do_chfilename();
  656.         av[1] = av1_bak;
  657.     
  658.     ;;break;
  659.     case _I_findstr_:
  660.      strcpy (Fstr, value); 
  661.     ;;break;
  662.     case _I_fname_:
  663.      strcpy (Ep->name, value); 
  664.     ;;break;
  665.     case _I_followcursor_:
  666.      SETF_FOLLOWCURSOR (Ep, test_arg (value, GETF_FOLLOWCURSOR (Ep))); 
  667.     ;;break;
  668.     case _I_globalsearch_:
  669.      SETF_GLOBALSEARCH (Ep, test_arg (value, GETF_GLOBALSEARCH (Ep))); 
  670.     ;;break;
  671.     case _I_gtbformat_:
  672.      GTB_Format = strrep (GTB_Format, value); 
  673.     ;;break;
  674.     case _I_hgpen_:
  675.      BLOCK_FPEN(Ep) = atol(value); 
  676.     ;;break;
  677.     case _I_icon_:
  678.     
  679.         sscanf (value, "%ld %ld", &array[0], &array[1]);
  680.  
  681.         Ep->config.iwinx      = array[0];
  682.         Ep->config.iwiny      = array[1];
  683.  
  684.         if (GETF_ICONMODE(Ep)) {
  685.         MoveWindow (Ep->win, Ep->config.winx - Ep->win->LeftEdge,
  686.                     Ep->config.winy - Ep->win->TopEdge);
  687.         } /* if */
  688.     
  689.     ;;break;
  690.     case _I_iconactive_:
  691.      SETF_ICONACTIVE (Ep, test_arg (value, GETF_ICONACTIVE (Ep))); 
  692.     ;;break;
  693.     case _I_iconmode_:
  694.     
  695.         array[0] = test_arg(value, GETF_ICONMODE (Ep));
  696.         if (array[0] != GETF_ICONMODE (Ep))
  697.             if (array[0]) iconify ();
  698.             else      uniconify (); 
  699.     ;;break;
  700.     case _I_icontitle_:
  701.      strcpy (icontitle_pattern, value); 
  702.     ;;break;
  703.     case _I_ignorecase_:
  704.      SETF_IGNORECASE (Ep, test_arg (value, GETF_IGNORECASE (Ep))); 
  705.     ;;break;
  706.     case _I_infixmode_:
  707.      MathInfix = test_arg (value, MathInfix); 
  708.     ;;break;
  709.     case _I_insertmode_:
  710.      SETF_INSERTMODE (Ep, test_arg (value, GETF_INSERTMODE (Ep))); 
  711.     ;;break;
  712.     case _I_keytable_:
  713.     
  714.         av[1] = value;
  715.         do_use_keytable();
  716.         av[1] = av1_bak;
  717.     
  718.     ;;break;
  719.     case _I_margin_:
  720.      Ep->config.margin = atol(value); 
  721.     ;;break;
  722.     case _I_menufontname_:
  723.     
  724.         menufont_ta.ta_Name = strrep (menufont_ta.ta_Name, value);
  725.         verify_menufont();
  726.         
  727.     ;;break;
  728.     case _I_menufontsize_:
  729.     
  730.         menufont_ta.ta_YSize = atol(value);
  731.         verify_menufont();
  732.         
  733.     ;;break;
  734.     case _I_menustrip_:
  735.     
  736.         av[1] = value;
  737.         do_use_menustrip();
  738.         av[1] = av1_bak;
  739.     
  740.     ;;break;
  741.     case _I_modified_:
  742.      SETF_MODIFIED (Ep, test_arg (value, GETF_MODIFIED (Ep))); 
  743.     ;;break;
  744.     case _I_nicepaging_:
  745.      SETF_NICEPAGING (Ep, test_arg (value, GETF_NICEPAGING (Ep))); 
  746.     ;;break;
  747.     case _I_norequest_:
  748.      SETF_NOREQUEST (Ep, test_arg (value, GETF_NOREQUEST (Ep))); 
  749.     ;;break;
  750.     case _I_parcol_:
  751.      Ep->config.wwcol = atol(value); 
  752.     ;;break;
  753.     case _I_pens_:
  754.     
  755.         sscanf (value, "%ld %ld %ld %ld %ld %ld", &array[0], &array[1], &array[2], &array[3], &array[4], &array[5]);
  756.  
  757.         TEXT_FPEN(Ep) = array[0];
  758.         TEXT_BPEN(Ep) = array[1];
  759.         BLOCK_FPEN(Ep) = array[2];
  760.         BLOCK_BPEN(Ep) = array[3];
  761.         TITLE_FPEN(Ep) = array[4];
  762.         TITLE_BPEN(Ep) = array[5];
  763.  
  764.         if (!GETF_ICONMODE(Ep))
  765.         text_redisplay ();
  766.  
  767.         SETF_MFORCETITLE(Ep,1);
  768.     
  769.     ;;break;
  770.     case _I_pos_:
  771.     {
  772.         struct TextMarker pos;
  773.         if (VSTK_Internal)
  774.         sscanf (value, "%08lx %08lx %08lx", &array[0],  &array[1], &array[2]);
  775.         else {
  776.         sscanf (value, "%s %ld %ld", tmp_buffer, &array[1], &array[2]);
  777.         array[0] = (long)finded (tmp_buffer, 0);
  778.         } /* if */
  779.  
  780.         pos.ep    = (void*)array[0];
  781.         pos.line    = array[1];
  782.         pos.column    = array[2];
  783.  
  784.     /* /* **** MISSING SAFETY CHECK!!!! **** */
  785.  
  786.         text_sync ();
  787.  
  788.         text_cursor (1);
  789.         switch_ed (pos.ep);
  790.         text_cursor (0);
  791.  
  792.         if (IntuitionBase->ActiveWindow != Ep->win) {
  793.         if (GETF_ACTIVATETOFRONT(Ep))
  794.             WindowToFront (Ep->win);
  795.         ActivateWindow (Ep->win);
  796.         }
  797.  
  798.         if (pos.line >= Ep->lines)
  799.         Ep->line = Ep->lines - 1;
  800.         else
  801.         Ep->line = pos.line;
  802.  
  803.         Ep->column = pos.column;
  804.  
  805.         text_load ();
  806.         text_adjust (FALSE);
  807.     }
  808.     ;;break;
  809.     case _I_repstr_:
  810.      strcpy (Rstr, value); 
  811.     ;;break;
  812.     case _I_reqpattern_:
  813.      strcpy (pattern, value); 
  814.     ;;break;
  815.     case _I_rxresult_:
  816.     {
  817.         av[1] = value;
  818.         put_rexx_result();
  819.         av[1] = av1_bak;
  820.     }
  821.     ;;break;
  822.     case _I_saveicons_:
  823.      SETF_SAVEICONS (Ep, test_arg (value, GETF_SAVEICONS (Ep))); 
  824.     ;;break;
  825.     case _I_savetabs_:
  826.      SETF_SAVETABS (Ep, test_arg (value, GETF_SAVETABS (Ep))); 
  827.     ;;break;
  828.     case _I_scanf_:
  829.      String = strrep (String, value); 
  830.     ;;break;
  831.     case _I_shortlines_:
  832.      SETF_SLINE (Ep, test_arg (value, GETF_SLINE (Ep))); 
  833.     ;;break;
  834.     case _I_showtitle_:
  835.      SETF_SHOWTITLE (Ep, test_arg (value, GETF_SHOWTITLE (Ep))); 
  836.     ;;break;
  837.     case _I_simpletabs_:
  838.      SETF_SIMPLETABS (Ep, test_arg (value, GETF_SIMPLETABS (Ep))); 
  839.     ;;break;
  840.     case _I_sourcebreaks_:
  841.      SETF_SOURCEBREAKS (Ep, test_arg (value, GETF_SOURCEBREAKS (Ep))); 
  842.     ;;break;
  843.     case _I_tabstop_:
  844.      Ep->config.tabstop = atol(value); 
  845.     ;;break;
  846.     case _I_tbpen_:
  847.      TITLE_BPEN(Ep) = atol(value); 
  848.     ;;break;
  849.     case _I_tfpen_:
  850.      TITLE_FPEN(Ep) = atol(value); 
  851.     ;;break;
  852.     case _I_title_:
  853.      strcpy (title_pattern, value); 
  854.     ;;break;
  855.     case _I_viewmode_:
  856.      SETF_VIEWMODE (Ep, test_arg (value, GETF_VIEWMODE (Ep))); 
  857.     ;;break;
  858.     case _I_warningsoncmdshell_:
  859.      CMDSH_WarningsOut = test_arg (value, CMDSH_WarningsOut); 
  860.     ;;break;
  861.     case _I_window_:
  862.     
  863.         sscanf (value, "%ld %ld %ld %ld", &array[0], &array[1], &array[2], &array[3]);
  864.  
  865.         Ep->config.winx     = array[0];
  866.         Ep->config.winy     = array[1];
  867.         Ep->config.winwidth  = array[2];
  868.         Ep->config.winheight = array[3];
  869.  
  870.         if (!GETF_ICONMODE(Ep)) {
  871.         MoveWindow (Ep->win, Ep->config.winx - Ep->win->LeftEdge,
  872.                     Ep->config.winy - Ep->win->TopEdge);
  873.         SizeWindow (Ep->win, Ep->config.winwidth  - Ep->win->Width,
  874.                     Ep->config.winheight - Ep->win->Height);
  875.         } /* if */
  876.     
  877.     ;;break;
  878.     case _I_windowcycling_:
  879.      SETF_WINDOWCYCLING (Ep, test_arg (value, GETF_WINDOWCYCLING (Ep))); 
  880.     ;;break;
  881.     case _I_windowtitles_:
  882.      SETF_WINDOWTITLES (Ep, test_arg (value, GETF_WINDOWTITLES (Ep))); 
  883.     ;;break;
  884.     case _I_wordwrap_:
  885.      SETF_WORDWRAP (Ep, test_arg (value, GETF_WORDWRAP (Ep))); 
  886.     ;;break;
  887.     default:
  888.     return 0;
  889.     }
  890.     return 1;
  891. } /* spc_set */
  892.  
  893. static int spc_say(long lock) {
  894.     long array[6];
  895.     switch (lock) {
  896. /* $ (@ITERATE@$ (@IF@?SAY@TRUE )) */
  897.     case _I_activetofront_:
  898.      warn("%s switched %s", spc_names[_I_activetofront_], GETF_ACTIVATETOFRONT (Ep)? __on: __off); 
  899.     ;;break;
  900.     case _I_appicon_:
  901.      warn("%s switched %s", spc_names[_I_appicon_], GETF_APIC_ACTIVE (Ep)? __on: __off); 
  902.     ;;break;
  903.     case _I_appiconclickaction_:
  904.      warn("%s set to %d", spc_names[_I_appiconclickaction_], APIC_ActionDblClick); 
  905.     ;;break;
  906.     case _I_appicondropaction_:
  907.      warn("%s set to %d", spc_names[_I_appicondropaction_], APIC_ActionDrop); 
  908.     ;;break;
  909.     case _I_appiconname_:
  910.      warn("%s set to %d", spc_names[_I_appiconname_], APIC_IconFile); 
  911.     ;;break;
  912.     case _I_appicontitle_:
  913.      warn("%s set to %d", spc_names[_I_appicontitle_], APIC_IconTitle); 
  914.     ;;break;
  915.     case _I_ascii_:
  916.      warn("%s set to %d", spc_names[_I_ascii_], Current[Ep->column]); 
  917.     ;;break;
  918.     case _I_autoindent_:
  919.      warn("%s switched %s", spc_names[_I_autoindent_], GETF_AUTOINDENT (Ep)? __on: __off); 
  920.     ;;break;
  921.     case _I_autosplit_:
  922.      warn("%s switched %s", spc_names[_I_autosplit_], GETF_AUTOSPLIT (Ep)? __on: __off); 
  923.     ;;break;
  924.     case _I_autounblock_:
  925.      warn("%s switched %s", spc_names[_I_autounblock_], GETF_AUTOUNBLOCK (Ep)? __on: __off); 
  926.     ;;break;
  927.     case _I_bbpen_:
  928.      warn("%s set to %d", spc_names[_I_bbpen_], BLOCK_BPEN(Ep)); 
  929.     ;;break;
  930.     case _I_bgpen_:
  931.      warn("%s set to %d", spc_names[_I_bgpen_], TEXT_BPEN(Ep)); 
  932.     ;;break;
  933.     case _I_block_:
  934.     return 0;
  935.     ;;break;
  936.     case _I_cmdshell_:
  937.      warn("%s switched %s", spc_names[_I_cmdshell_], GETF_CMDSH_ACTIVE (Ep)? __on: __off); 
  938.     ;;break;
  939.     case _I_cmdshellname_:
  940.      warn("%s set to %d", spc_names[_I_cmdshellname_], CMDSH_FileName); 
  941.     ;;break;
  942.     case _I_cmdshellprompt_:
  943.      warn("%s set to %d", spc_names[_I_cmdshellprompt_], CMDSH_Prompt); 
  944.     ;;break;
  945.     case _I_colno_:
  946.      warn("%s set to %d", spc_names[_I_colno_], Ep->column + 1); 
  947.     ;;break;
  948.     case _I_comlinemode_:
  949.      warn("%s switched %s", spc_names[_I_comlinemode_], GETF_COMLINEMODE (Ep)? __on: __off); 
  950.     ;;break;
  951.     case _I_currentdir_:
  952.     return 0;
  953.     ;;break;
  954.     case _I_currentline_:
  955.     return 0;
  956.     ;;break;
  957.     case _I_currentword_:
  958.     return 0;
  959.     ;;break;
  960.     case _I_debug_:
  961.      warn("%s switched %s", spc_names[_I_debug_], GETF_DEBUG (Ep)? __on: __off); 
  962.     ;;break;
  963.     case _I_dobackup_:
  964.      warn("%s switched %s", spc_names[_I_dobackup_], GETF_DOBACK (Ep)? __on: __off); 
  965.     ;;break;
  966.     case _I_ed_:
  967.     return 0;
  968.     ;;break;
  969.     case _I_errorsoncmdshell_:
  970.      warn("%s switched %s", spc_names[_I_errorsoncmdshell_], CMDSH_ErrorsOut? __on: __off); 
  971.     ;;break;
  972.     case _I_fgpen_:
  973.      warn("%s set to %d", spc_names[_I_fgpen_], TEXT_FPEN(Ep)); 
  974.     ;;break;
  975.     case _I_filename_:
  976.     return 0;
  977.     ;;break;
  978.     case _I_findstr_:
  979.      warn("%s set to %s", spc_names[_I_findstr_], Fstr); 
  980.     ;;break;
  981.     case _I_firstnb_:
  982.     return 0;
  983.     ;;break;
  984.     case _I_fname_:
  985.      warn("%s set to %s", spc_names[_I_fname_], Ep->name); 
  986.     ;;break;
  987.     case _I_followcursor_:
  988.      warn("%s switched %s", spc_names[_I_followcursor_], GETF_FOLLOWCURSOR (Ep)? __on: __off); 
  989.     ;;break;
  990.     case _I_globalsearch_:
  991.      warn("%s switched %s", spc_names[_I_globalsearch_], GETF_GLOBALSEARCH (Ep)? __on: __off); 
  992.     ;;break;
  993.     case _I_gtbformat_:
  994.      warn("%s set to %d", spc_names[_I_gtbformat_], GTB_Format); 
  995.     ;;break;
  996.     case _I_hgpen_:
  997.      warn("%s set to %d", spc_names[_I_hgpen_], BLOCK_FPEN(Ep)); 
  998.     ;;break;
  999.     case _I_icon_:
  1000.     return 0;
  1001.     ;;break;
  1002.     case _I_iconactive_:
  1003.      warn("%s switched %s", spc_names[_I_iconactive_], GETF_ICONACTIVE (Ep)? __on: __off); 
  1004.     ;;break;
  1005.     case _I_iconmode_:
  1006.      warn("%s switched %s", spc_names[_I_iconmode_], GETF_ICONMODE (Ep)? __on: __off); 
  1007.     ;;break;
  1008.     case _I_icontitle_:
  1009.      warn("%s set to %s", spc_names[_I_icontitle_], icontitle_pattern); 
  1010.     ;;break;
  1011.     case _I_ignorecase_:
  1012.      warn("%s switched %s", spc_names[_I_ignorecase_], GETF_IGNORECASE (Ep)? __on: __off); 
  1013.     ;;break;
  1014.     case _I_infixmode_:
  1015.      warn("%s switched %s", spc_names[_I_infixmode_], MathInfix? __on: __off); 
  1016.     ;;break;
  1017.     case _I_insertmode_:
  1018.      warn("%s switched %s", spc_names[_I_insertmode_], GETF_INSERTMODE (Ep)? __on: __off); 
  1019.     ;;break;
  1020.     case _I_itemcheck_:
  1021.     return 0;
  1022.     ;;break;
  1023.     case _I_keytable_:
  1024.     return 0;
  1025.     ;;break;
  1026.     case _I_lineno_:
  1027.      warn("%s set to %d", spc_names[_I_lineno_], Ep->line + 1); 
  1028.     ;;break;
  1029.     case _I_margin_:
  1030.      warn("%s set to %d", spc_names[_I_margin_], Ep->config.margin); 
  1031.     ;;break;
  1032.     case _I_menufontname_:
  1033.      warn("%s set to %d", spc_names[_I_menufontname_], menufont_ta.ta_Name); 
  1034.     ;;break;
  1035.     case _I_menufontsize_:
  1036.      warn("%s set to %d", spc_names[_I_menufontsize_], menufont_ta.ta_YSize); 
  1037.     ;;break;
  1038.     case _I_menustrip_:
  1039.     return 0;
  1040.     ;;break;
  1041.     case _I_modified_:
  1042.      warn("%s switched %s", spc_names[_I_modified_], GETF_MODIFIED (Ep)? __on: __off); 
  1043.     ;;break;
  1044.     case _I_nicepaging_:
  1045.      warn("%s switched %s", spc_names[_I_nicepaging_], GETF_NICEPAGING (Ep)? __on: __off); 
  1046.     ;;break;
  1047.     case _I_norequest_:
  1048.      warn("%s switched %s", spc_names[_I_norequest_], GETF_NOREQUEST (Ep)? __on: __off); 
  1049.     ;;break;
  1050.     case _I_numlines_:
  1051.      warn("%s set to %d", spc_names[_I_numlines_], Ep->lines); 
  1052.     ;;break;
  1053.     case _I_parcol_:
  1054.      warn("%s set to %d", spc_names[_I_parcol_], Ep->config.wwcol); 
  1055.     ;;break;
  1056.     case _I_pens_:
  1057.     return 0;
  1058.     ;;break;
  1059.     case _I_pos_:
  1060.     return 0;
  1061.     ;;break;
  1062.     case _I_prevnbline_:
  1063.     return 0;
  1064.     ;;break;
  1065.     case _I_recentword_:
  1066.     return 0;
  1067.     ;;break;
  1068.     case _I_repstr_:
  1069.      warn("%s set to %s", spc_names[_I_repstr_], Rstr); 
  1070.     ;;break;
  1071.     case _I_reqpattern_:
  1072.      warn("%s set to %s", spc_names[_I_reqpattern_], pattern); 
  1073.     ;;break;
  1074.     case _I_reqresult_:
  1075.      warn("%s set to %s", spc_names[_I_reqresult_], ReqString); 
  1076.     ;;break;
  1077.     case _I_restofline_:
  1078.     return 0;
  1079.     ;;break;
  1080.     case _I_rexxport_:
  1081.      warn("%s set to %s", spc_names[_I_rexxport_], RexxPortName); 
  1082.     ;;break;
  1083.     case _I_rxresult_:
  1084.     return 0;
  1085.     ;;break;
  1086.     case _I_saveicons_:
  1087.      warn("%s switched %s", spc_names[_I_saveicons_], GETF_SAVEICONS (Ep)? __on: __off); 
  1088.     ;;break;
  1089.     case _I_savetabs_:
  1090.      warn("%s switched %s", spc_names[_I_savetabs_], GETF_SAVETABS (Ep)? __on: __off); 
  1091.     ;;break;
  1092.     case _I_scanf_:
  1093.      warn("%s set to %d", spc_names[_I_scanf_], String); 
  1094.     ;;break;
  1095.     case _I_shortlines_:
  1096.      warn("%s switched %s", spc_names[_I_shortlines_], GETF_SLINE (Ep)? __on: __off); 
  1097.     ;;break;
  1098.     case _I_showtitle_:
  1099.      warn("%s switched %s", spc_names[_I_showtitle_], GETF_SHOWTITLE (Ep)? __on: __off); 
  1100.     ;;break;
  1101.     case _I_simpletabs_:
  1102.      warn("%s switched %s", spc_names[_I_simpletabs_], GETF_SIMPLETABS (Ep)? __on: __off); 
  1103.     ;;break;
  1104.     case _I_sourcebreaks_:
  1105.      warn("%s switched %s", spc_names[_I_sourcebreaks_], GETF_SOURCEBREAKS (Ep)? __on: __off); 
  1106.     ;;break;
  1107.     case _I_tabstop_:
  1108.      warn("%s set to %d", spc_names[_I_tabstop_], Ep->config.tabstop); 
  1109.     ;;break;
  1110.     case _I_tbpen_:
  1111.      warn("%s set to %d", spc_names[_I_tbpen_], TITLE_BPEN(Ep)); 
  1112.     ;;break;
  1113.     case _I_tfpen_:
  1114.      warn("%s set to %d", spc_names[_I_tfpen_], TITLE_FPEN(Ep)); 
  1115.     ;;break;
  1116.     case _I_title_:
  1117.      warn("%s set to %s", spc_names[_I_title_], title_pattern); 
  1118.     ;;break;
  1119.     case _I_txtfontname_:
  1120.      warn("%s set to %s", spc_names[_I_txtfontname_], (Ep->font? Ep->font->tf_Message.mn_Node.ln_Name: "*Defaultfont*")); 
  1121.     ;;break;
  1122.     case _I_txtfontsize_:
  1123.      warn("%s set to %d", spc_names[_I_txtfontsize_], (Ep->font? Ep->font->tf_YSize: (Ysize - LineDistance))); 
  1124.     ;;break;
  1125.     case _I_version_:
  1126.      warn("%s set to %s", spc_names[_I_version_], version); 
  1127.     ;;break;
  1128.     case _I_viewmode_:
  1129.      warn("%s switched %s", spc_names[_I_viewmode_], GETF_VIEWMODE (Ep)? __on: __off); 
  1130.     ;;break;
  1131.     case _I_warningsoncmdshell_:
  1132.      warn("%s switched %s", spc_names[_I_warningsoncmdshell_], CMDSH_WarningsOut? __on: __off); 
  1133.     ;;break;
  1134.     case _I_window_:
  1135.     return 0;
  1136.     ;;break;
  1137.     case _I_windowcycling_:
  1138.      warn("%s switched %s", spc_names[_I_windowcycling_], GETF_WINDOWCYCLING (Ep)? __on: __off); 
  1139.     ;;break;
  1140.     case _I_windowtitles_:
  1141.      warn("%s switched %s", spc_names[_I_windowtitles_], GETF_WINDOWTITLES (Ep)? __on: __off); 
  1142.     ;;break;
  1143.     case _I_wordwrap_:
  1144.      warn("%s switched %s", spc_names[_I_wordwrap_], GETF_WORDWRAP (Ep)? __on: __off); 
  1145.     ;;break;
  1146.     default:
  1147.     return 0;
  1148.     }
  1149.     return 1;
  1150. } /* spc_say */
  1151.  
  1152.  
  1153.  
  1154.  
  1155.